// 工具箱类别
export const categories = {
  // 逻辑类别
  logic: {
    kind: 'category',
    name: '逻辑',
    colour: '210',
    contents: [
      { kind: 'block', type: 'controls_if' },
      { kind: 'block', type: 'logic_compare' },
      { kind: 'block', type: 'logic_operation' },
      { kind: 'block', type: 'logic_negate' },
      { kind: 'block', type: 'logic_boolean' },
      { kind: 'block', type: 'logic_null' },
      { kind: 'block', type: 'logic_ternary' },
    ],
  },
  loop: {
    kind: 'category',
    name: '循环',
    colour: '120',
    contents: [
      { kind: 'block', type: 'controls_repeat_ext' },
      { kind: 'block', type: 'controls_whileUntil' },
      { kind: 'block', type: 'controls_for' },
      { kind: 'block', type: 'controls_forEach' },
      { kind: 'block', type: 'controls_flow_statements' },
    ],
  },
  // 列表类别
  list: {
    kind: 'category',
    name: '列表',
    colour: '260',
    contents: [
      { kind: 'block', type: 'lists_create_with' },
      { kind: 'block', type: 'lists_repeat' },
      { kind: 'block', type: 'lists_length' },
      { kind: 'block', type: 'lists_isEmpty' },
      { kind: 'block', type: 'lists_indexOf' },
      { kind: 'block', type: 'lists_getIndex' },
      { kind: 'block', type: 'lists_setIndex' },
      { kind: 'block', type: 'lists_getSublist' },
      { kind: 'block', type: 'lists_sort' },
      { kind: 'block', type: 'lists_split' },
      { kind: 'block', type: 'lists_reverse' },
    ],
  },
  // 数学类别
  math: {
    kind: 'category',
    name: '数学',
    colour: '230',
    contents: [
      { kind: 'block', type: 'math_number' },
      { kind: 'block', type: 'math_arithmetic' },
      { kind: 'block', type: 'math_single' },
      { kind: 'block', type: 'math_trig' },
      { kind: 'block', type: 'math_constant' },
      { kind: 'block', type: 'math_number_property' },
      { kind: 'block', type: 'math_round' },
      { kind: 'block', type: 'math_on_list' },
      { kind: 'block', type: 'math_modulo' },
      { kind: 'block', type: 'math_constrain' },
      { kind: 'block', type: 'math_random_int' },
      { kind: 'block', type: 'math_random_float' },
      // { kind: 'block', type: 'math_atan2' }
    ],
  },
  // 文本类别
  text: {
    kind: 'category',
    name: '文本',
    colour: '160',
    contents: [
      { kind: 'block', type: 'text' },
      { kind: 'block', type: 'text_join' },
      { kind: 'block', type: 'text_append' },
      { kind: 'block', type: 'text_length' },
      { kind: 'block', type: 'text_isEmpty' },
      { kind: 'block', type: 'text_indexOf' },
      { kind: 'block', type: 'text_charAt' },
      { kind: 'block', type: 'text_getSubstring' },
      { kind: 'block', type: 'text_changeCase' },
      { kind: 'block', type: 'text_trim' },
      {
        kind: 'block',
        type: 'sync_log',
        inputs: {
          TEXT: {
            shadow: {
              type: 'text',
              fields: {
                TEXT: 'Hello, World!',
              },
            },
          },
        },
      },
      {
        kind: 'block',
        type: 'async_log',
        inputs: {
          TEXT: {
            shadow: {
              type: 'text',
              fields: {
                TEXT: 'Hello, World!',
              },
            },
          },
        },
      },
    ],
  },
  // 变量类别
  variables: {
    kind: 'category',
    name: '变量',
    colour: '330',
    custom: 'VARIABLE',
  },
  // 函数类别
  functions: {
    kind: 'category',
    name: '函数',
    colour: '290',
    custom: 'PROCEDURE',
  },

  // 系统函数类别
  systemFunction: {
    kind: 'category',
    name: '系统函数',
    colour: '290',
    contents: [
      { kind: 'block', type: 'system_context_state_get_value' },
      { kind: 'block', type: 'system_context_state_set_value' },
      { kind: 'block', type: 'system_logger_log' },
      { kind: 'block', type: 'system_mimic_back' },
      { kind: 'block', type: 'system_mimic_close' },
      { kind: 'block', type: 'system_mimic_open' },
      { kind: 'block', type: 'system_mimic_open_new_tab' },
      { kind: 'block', type: 'system_mimic_open_overlay' },
      { kind: 'block', type: 'system_mimic_open_popup' },
      { kind: 'block', type: 'system_mimic_preload' },
      { kind: 'block', type: 'system_object_get_child_node_paths' },
      { kind: 'block', type: 'system_object_get_inner_function_methods' },
      { kind: 'block', type: 'system_page_variable_get_value' },
      { kind: 'block', type: 'system_page_variable_set_value' },
      { kind: 'block', type: 'system_runtime_update_control' },
      { kind: 'block', type: 'system_session_context_get_value' },
      { kind: 'block', type: 'system_session_context_set_value' },
      { kind: 'block', type: 'system_utils_get_user_name' },
      { kind: 'block', type: 'system_utils_redirect' },
      { kind: 'block', type: 'system_utils_schedule_task' },
      { kind: 'block', type: 'system_variable_get_history_value' },
      { kind: 'block', type: 'system_variable_get_history_values' },
      { kind: 'block', type: 'system_variable_get_quality' },
      { kind: 'block', type: 'system_variable_get_quality_int' },
      { kind: 'block', type: 'system_variable_get_value' },
      { kind: 'block', type: 'system_variable_is_bad_quality' },
      { kind: 'block', type: 'system_variable_is_good_quality' },
      { kind: 'block', type: 'system_variable_set_value' },
    ],
  },
  customFunction: {
    kind: 'category',
    name: '自定义函数',
    colour: '#290',
    contents: [
      {
        kind: 'category',
        name: '数据处理',
        contents: [
          {
            kind: 'category',
            name: '字符串操作',
            contents: [
              {
                kind: 'block',
                type: 'custom_string_concat',
              },
              {
                kind: 'block',
                type: 'custom_string_split',
              },
            ],
          },
          {
            kind: 'category',
            name: '数值计算',
            contents: [
              {
                kind: 'block',
                type: 'custom_add',
              },
              {
                kind: 'block',
                type: 'custom_multiply',
              },
            ],
          },
        ],
      },
      {
        kind: 'category',
        name: '流程控制',
        contents: [
          {
            kind: 'block',
            type: 'custom_if_else',
          },
          {
            kind: 'block',
            type: 'custom_loop',
          },
        ],
      },
    ],
  },
};
